package com.xian.im.modules.message;

import com.xian.im.common.enums.ConsumerQueueEnum;
import com.xian.im.common.proto.MsgMessage;
import com.xian.im.common.utils.template.RabbitTemplateUtil;
import com.xian.im.message.model.RabbitMsg;
import lombok.extern.slf4j.Slf4j;

/**
 * @program: xian-im-server
 * @description:
 * @author: liru.xian
 * @create: 2021-01-26 10:11
 **/
@Slf4j
public class GroupHandler {

    /**
     * 群组消息发送 包括自己
     * @param response
     * @param groupId
     */
    public static void groupSendAll(MsgMessage response, String groupId){
        RabbitMsg groupMsg = new RabbitMsg();
        groupMsg.setId(groupId);
        groupMsg.setResponse(response);
        RabbitTemplateUtil.sendMes(ConsumerQueueEnum.GROUP_MSG_SEND.getExchange() , groupMsg);
    }
}
